// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import realThing from "../../TS/BASE/realThing";
import { gif } from "../../TS/BASE/spineANDgif/gif";
import DL from "../../TS/Ditu/des/DL";
import turn from "../../TS/game/time/turn";
import GeZiManager from "../../TS/Manager/GeZiManager";
import MessageCenter from "../../TS/Message/MessageCenter";

const {ccclass, property} = cc._decorator;

@ccclass
export default class FHT extends realThing {
turn:number=0
round:number=0
FT:number=0
@property(cc.SpriteFrame)
B:cc.SpriteFrame=null
@property(cc.SpriteFrame)
R:cc.SpriteFrame=null


DZD:boolean=false
start() {
    turn.Too.push(this);
    this.round = turn.round;
  //  if (turn.round%12==2||turn.round%12==7) { turn.round+=1  }
   // this.turn = turn.turn;
    if (   this.turn%2==0) {
        this.node.getComponent(cc.Sprite).spriteFrame=this.R
    }else {  this.node.getComponent(cc.Sprite).spriteFrame=this.B}
  
  GeZiManager.BDZD.push(this.ZB)
  this.node.children[1].getComponent(gif).changeF(this.turn-1,1)
}




BZ() {
   
   
    GeZiManager.Tcharacter=this.getc(this.turn)  

this.node.children[0].getComponent(gif).moveToNextFrame(0,11,0);
GeZiManager.Tcharacter.FH(this.ZB,this.FT)

GeZiManager.shanchu(GeZiManager.BDZD,this.ZB)


this.fadeOutAndDisappear(this.node,1200)
} 









turnPass() {
//if (!(turn.round%12==2||turn.round%12==7)) {    
if(turn.round==this.round+1&&turn.turn==this.FT){
console.log("fd")
this.BZ();
}
}
//}
}
